﻿using Framework.SqlSugarCore.Abstractions;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace my.abp.Domain.Shared.Entities
{
	/// <summary>
	/// 系统用户扩展机构表
	/// </summary>
	[SugarTable("SysUserExtOrg", "系统用户扩展机构表")]
	public class SysUserExtOrg : EntityBase
	{
		/// <summary>
		/// 用户Id
		/// </summary>
		[SugarColumn(ColumnDescription = "用户Id")]
		public long UserId { get; set; }

		/// <summary>
		/// 用户
		/// </summary>
		[Navigate(NavigateType.OneToOne, nameof(UserId))]
		public SysUser SysUser { get; set; }

		/// <summary>
		/// 机构Id
		/// </summary>
		[SugarColumn(ColumnDescription = "机构Id")]
		public long OrgId { get; set; }

		/// <summary>
		/// 机构
		/// </summary>
		[Navigate(NavigateType.OneToOne, nameof(OrgId))]
		public SysOrg SysOrg { get; set; }

		/// <summary>
		/// 工号
		/// </summary>
		[SugarColumn(ColumnDescription = "工号", Length = 32)]
		[MaxLength(32)]
		public string? JobNum { get; set; }

		/// <summary>
		/// 入职日期
		/// </summary>
		[SugarColumn(ColumnDescription = "入职日期")]
		public DateTime? JoinDate { get; set; }
	}
}
